<?php
/**
 * (commands) 核算物流成本
 */
namespace App\Console\Commands\MonthlyReportLT;

use App\Logic\MonthlyReportLT\MatchDeliverySku;
use Illuminate\Console\Command;
class PaymentMatchDeliverySku extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'lt-payment:match-delivery-sku {date=null}';

    /**
     * The console command description.
     * 产品物流费核算
     * @var string
     */
    protected $description = 'match delivery sku';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $date = $this->argument('date');
        $func = $this->choice('choice exe func-item: (in sequential order & dont repeat)',
            [
                '_matchSalesAndDelivery',
                '_matchOrderItem',
                '_matchSalesAndDeliveryAgain',
                '_matchExSalesAndThDelivery',
                '_matchSalesCancelAndDelivery',
                '_matchSalesEx',
            ]);
        MatchDeliverySku::exe($func,$date);
        $this->info($func.' exe success!');
        die('finish');
    }
}
